import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: () => import('@/views/home/index.vue')
  },

  // 登录相关
  {
    path: '/login',
    component: () => import('@/layouts/login-layout/index.vue'),
    children: [
      {
        path: '',
        component: () => import('@/views/login/login/index.vue')
      },
      {
        path: 'register',
        component: () => import('@/views/login/register/index.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
